/*
 * HttpH264Stream.h
 *
 *  Created on: Mar 25, 2013
 *      Author: longwuwei
 */

#ifndef HTTPH264STREAM_H_
#define HTTPH264STREAM_H_

#ifdef __cplusplus
#define __STDC_FORMAT_MACROS // C++ should define this for PRIu64
#define __STDC_LIMIT_MACROS  // C++ should define this for UINT32_MAX
#endif

#ifdef __cplusplus
extern "C" {
#endif

#include "mp4_io.h"
#include "moov.h"
#include "output_bucket.h"

#ifdef BUILDING_H264_STREAMING
#include "output_mp4.h"
#define X_MOD_STREAMING_KEY X_MOD_H264_STREAMING_KEY
#define X_MOD_STREAMING_VERSION X_MOD_H264_STREAMING_VERSION
#endif

#ifdef BUILDING_SMOOTH_STREAMING
#include "ism_reader.h"
#include "output_ismv.h"
#define X_MOD_STREAMING_KEY X_MOD_SMOOTH_STREAMING_KEY
#define X_MOD_STREAMING_VERSION X_MOD_SMOOTH_STREAMING_VERSION
#endif

#ifdef BUILDING_FLV_STREAMING
#include "output_flv.h"
#endif

#ifdef __cplusplus
} /*extern C definitions */
#endif

/**
 * HttpH264Stream class init
 */
class HttpH264Stream {
public:
	HttpH264Stream();
	virtual ~HttpH264Stream();

	static int mp4_process(const char* filename, uint64_t filesize, int verbose,
	                struct bucket_t** buckets,
	                struct mp4_split_options_t* options);

	int test();

protected:
	static int rxs_get_bucket(char const* filename, bucket_t** buckets,
	                          mp4_split_options_t* options);

};

#endif /* HTTPH264STREAM_H_ */
